﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CacheSharp.Core
{
    /// <summary>
    /// 表格写入接口
    /// </summary>
    interface ITableWriter
    {
        TimeSpan DefaultExpireTime { get; set; }
        bool SetTable(string groupName, string tableName, string pkName, DataTable table, DateTime expiry);
        bool SetTable(string groupName, string tableName, string pkName, DataTable table);
        bool SetRow(string groupName, string tableName, string pkName, DataRow row, DateTime expiry);
        bool SetRow(string groupName, string tableName, string pkName, DataRow row);
        bool SetRows(string groupName, string tableName, string pkName, DataRow[] rows, DateTime expiry);
        bool SetRows(string groupName, string tableName, string pkName, DataRow[] rows);
        bool RemoveRow(string groupName, string tableName, object pkValue);
        bool RemoveTable(string groupName, string tableName);
        bool RemoveGroup(string groupName);
        bool RemoveAll();
    }
}
